/**
 * OnShow - _LifecycleManager 生命周期管理
 * 2018年11月15日 16点10分
 * nico@coser.pub
 */
module.exports._init = function () {
  this.onShowCount = this.onShowCount || 0;
  this.showLib = {};
  let orginOnShow = this.onShow;
  this.onShow = function(){
    for (let index in this.showLib){
      if (this.showLib.hasOwnProperty(index)){
        setTimeout(this.showLib[index].bind(this), 20);
      }
    }
  }
  this.appendOnShowEvent = function(name, handler){
    this.showLib[name] = handler;
  }
  this.removeOnShowEvent = function (name) {
    this.showLib[name] = ()=>{};
  }
  this.clearOnShowEvent = function () {
    this.showLib = {};
  }
}